home *** CD-ROM | disk | FTP | other *** search
- Path: news.production.compuserve.com!news
- From: Alan Huff <74312.2300@CompuServe.COM>
- Newsgroups: comp.lang.c++
- Subject: The STL and nested structures
- Date: 3 Apr 1996 16:42:47 GMT
- Organization: Motorola Lexicus
- Message-ID: <4ju9q7$fa1$1@mhadg.production.compuserve.com>
-
- I am having a problem using the STL with structures defined within
- a class definition. Consider the following code fragment.
-
- >#include <vector.h>
- >class Bar {
- > struct Foo {
- > int value;
- > };
- >
- > vector< Foo > fooContainer;
- >}
-
- The compiler I am using (VC 4.1) refuses to compile. An error is
- generated the says "'Foo' : undeclared identifier" at line 75 in
- vector.h.
-
- Line 75 of vector.h
- > vector(size_type n, const T& value = T()) { ...
-
- If I move the structure Foo out of the class and into the global
- namespace there are no compilation errors.
-
- What am I missing??
-